package music.utils.join;

import music.dao.MemberDAO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by pc01 on 11/6/2014.
 */
@WebServlet("/Uid.do")
public class UidServletUtil extends HttpServlet {
    protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        PrintWriter out = res.getWriter();
        out.write("POST 방식 지원 안함");
    }

    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/html; charset=UTF-8");
        PrintWriter out = res.getWriter();
        String uid = req.getParameter("myuid");

        int readOne = MemberDAO.readOneUid(uid);
        System.out.println(readOne);
        out.print(MemberDAO.readOneUid(uid));
        out.flush();
        out.close();
    }
}
